<?php
use yii\helpers\Html;
use yii\helpers\Url;
use backend\controllers\DtActionFilter;

$project_state = Yii::$app->params['project_state'];

?>

<style type="text/css">
    .modal-footer .btn-primary {
        color: #fff;
        background-color: #2194f9;
        border-color: #2194f1 !important;
    }

    .details-btns .btn-primary {
        color: #2194f1 !important;
        background-color: #ffffff !important;
        border: 0px solid #2194f1 !important;
    }
   .details-btn:hover{
   	     border: 1px solid #bcdffb!important;
	    background: #e8f4fe!important;
	    color: #2194f1!important;
	    box-sizing: border-box; 
   	 }
.GTime {
    text-align: right;
    padding-right: 50px;
    height: 0px;
    margin-top: -42px;
}

</style>
<div class="row">
    <div class="assetPackage col-md-8">
        <p class="details-nav"><span><a href="<?php  echo Url::toRoute('/site/index',true);?>">办公大厅</a> > </span> <span><a href="<?php  echo Url::toRoute('/project',true);?>">项目管理</a>  > </span> <span> 项目详情</span></p>
        <h1><?= !empty($Base['borrower']) ? $Base['borrower'] : '' ?>
            <?php
            switch ($projectModel['status']) {
                case 4:
                    echo '<span class="jinDiaoTitle">' . $project_state[(string)$projectModel['status']] . '</span>';
                    break;
                case 5:
                    echo '<span class="jinDiaoTitle">' . $project_state[(string)$projectModel['status']] . '</span>';
                    break;
                default:
                    echo '';
            }
            ?>
<!--            <span class="jinDiaoTitle">尽调中</span>-->
        </h1>
        <p class="psmall">
                    <span>
                            本金 :
                            <strong><?= !empty($Base['principal']) ? \common\helps\formatMoney::format_money($Base['principal']) : ''; ?></strong>
                        </span>
            <span>
                            利息 :
                            <strong><?= !empty($Base['interest']) ? \common\helps\formatMoney::format_money($Base['interest']) : ''; ?></strong>
                        </span>
            <span>项目编号 :
                            <strong><?= !empty($Base['code']) ? $Base['code'] : ''; ?></strong>
                        </span>
            <span>省份地区 :
                            <strong><?= !empty($Base['country']) ? $Base['country'] : ''; ?></strong>
                        </span>
        </p>
        <p class="psmall">隶属资产包 :
            <span id="baoName">
                <?php
                if (DtActionFilter::checkProject('package_view', Yii::$app->request->get('package_id', 1))) {
                    ?>
                    <a target="_blank"
                       href="/package/detail-info?packageid=<?= Yii::$app->request->get('package_id', 1); ?>"><?= $packageName ?></a>
                    <?php
                }else{
                    ?>
                    <?= $packageName ?>
                    <?php
                }
                ?>
            </span>
        </p>
        <div class="col-md-12  col-sm-12 details-btns">
            <?php
            if (DtActionFilter::checkProject('project_like', $Base['id'])) {
                ?>
                <button type="button" class="btn btn-default details-btn like  btn-primary" id="flow"
                        data="flow-<?php echo $Base['flow']; ?>-1" style="width: 110px;">
                    <?= ($Base['flow'] == 1) ? Html::img('@web/image/projectDetails/isfocus.png', ['id' => 'flow_img', 'class' => 'pull-left ']) : Html::img('@web/image/projectDetails/focus.png', ['id' => 'flow_img', 'class' => 'pull-left ']) ?>
                    <span class="pull-left"><?= (($Base['flow'] == 1) ? '已关注' : '关注'); ?></span>
                </button>
                <?php
            }
            ?>
            <?php
            if (DtActionFilter::checkProject('project_down', $Base['id'])) {
                ?>
                <button type="button" class="btn btn-default details-btn"
                        onclick="window.location.href='/project/project-down-load?projectid=<?php echo $Base['id']; ?>'">
                    <img src="/image/projectDetails/download.png" class="pull-left ">
                    <span class="pull-left">下载报告</span>
                </button>
                <?php
            }
            ?>
            <?php
            if (DtActionFilter::checkProject('project_light', $Base['id'])) {
                ?>
                <button type="button" class="btn btn-default details-btn like" id="light_spot"
                        data="light_spot-<?php echo $Base['light_spot']; ?>-2">
                    <?= ($Base['light_spot'] == 1) ? Html::img('@web/image/projectDetails/isliangDian.png', ['id' => 'light_spot_img', 'class' => 'pull-left ']) : Html::img('@web/image/projectDetails/liangDian.png', ['id' => 'light_spot_img', 'class' => 'pull-left ']) ?>
                    <span class="pull-left  ">标记为亮点项目</span>
                </button>
                <?php
            }
            ?>

            <?php
            if (DtActionFilter::checkProject('project_permissions', $Base['id'])) {
                ?>
                <button type="button" class="btn btn-default details-btn" data-toggle="modal"
                                 data-target="#myModal1">
                    <img src="/image/projectDetails/quanXian.png" class="pull-left ">
                    <span class="pull-left  ">修改访问权限</span>
                </button>
                <?php
            }
            ?>

            <?php
            if (DtActionFilter::checkProject('project_team', $Base['id'])) {
                ?>
                <button type="button" class="btn btn-default details-btn" data-toggle="modal" data-target="#myModal2">
                    <img src="/image/projectDetails/tuanDui.png" class="pull-left ">
                    <span class="pull-left">配置团队</span>
                </button>
                <?php
            }
            ?>
        </div>
    </div>

    <div class="col-md-4 assetPackage2">
        <div class="row">
            <!--        	<div class="col-md-12 pull-right" style="padding-top: 70px;">-->
            <!--		                <img class="bind_hover_card pull-right per1" data-toggle="popover" data-placement="auto left" data-trigger="hover" src="/image/assetPackage/per.png" style="width: 47px;height: 47px;" data-original-title="" title="">-->
            <!--                        <img class="bind_hover_card pull-right per2" data-toggle="popover" data-placement="auto left" data-trigger="hover" src="/image/assetPackage/per.png" style="width: 47px;height: 47px;" data-original-title="" title="">-->
            <!--            </div>-->

            <div class="col-md-12 pull-right" style="padding-top: 70px;">
                <?php
                $init_avatar = '/image/projectDetails/per.png';

                //团队成员
                if (!empty($teamInfo['teamXZR']) && is_array($teamInfo['teamXZR'])) {
                    foreach ($teamInfo['teamXZR'] as $k => $v) {
                        echo '<img  src="'.$v['avatar'].'" data-toggle="popover" data-placement="auto left" 
                        data-trigger="hover" class="pull-right bind_hover_card per2"  style="width: 47px;height: 47px;" data-original-title=""
                        title="'.$v['role'].'" realName="'.$v['department'].$v['realname'].'">';
                    }
                }

                //项目经理
                if (!empty($teamInfo['teamFZR']) && is_array($teamInfo['teamFZR'])) {
                    foreach ($teamInfo['teamFZR'] as $k => $v) {
                        echo '<img  src="'.$v['avatar'].'" data-toggle="popover" data-placement="auto left" 
                        data-trigger="hover" class="pull-right bind_hover_card per2" style="width: 47px;height: 47px;" data-original-title=""
                        title="'.$v['role'].'" realName="'.$v['department'].$v['realname'].'">';
                    }
                }

                //项目总监
                if (!empty($teamInfo['teamZJ']) && is_array($teamInfo['teamZJ'])) {
                    foreach ($teamInfo['teamZJ'] as $k => $v) {
                        echo '<img  src="'.$v['avatar'].'" data-toggle="popover" data-placement="auto left" 
                        data-trigger="hover" class="pull-right bind_hover_card per2" style="width: 47px;height: 47px;" data-original-title=""
                        title="'.$v['role'].'" realName="'.$v['department'].$v['realname'].'">';
                    }
                }
                ?>
            </div>
        </div>
      
    </div>
    <div class="row">
        <p class="col-md-12 pull-right Gime" style="text-align: right;padding-right: 30px;height: 0px;margin-top: -42px;">
            <?= !empty($Base['updated_at'])?'更新时间&nbsp;:&nbsp;'.$Base['updated_at']:'更新时间&nbsp;:&nbsp; 暂无更新';?>
        </p>
    </div>
</div>



